Q: What can be written inside the class? OR What are the class members?

Class Members: are of 3 types
1. Instance OR non-static members
2. Static members
3. class, abstract class, interface and array


I. Instance members OR non-static members:
(a) Instance variable
(b) Constructor
(c) instance methods
(d) instance block

1. Instance members belogs to the object/instance. To access the Instance members of the class we need to create a object to the class.

2. Instance members can be directly accessed inside the instance members viz., constructor OR instance methods

3. Instance members cannot be accessed directly inside the static members. If you want to access you need to create a object to the class.

-----------------------------
II. static members
(a) static variables
(b) static method
(c) static block

1. Static members belongs to the class. Hence no need to create a object to the class to access the static members

2. Static members can be accessed directly inside the instance members and as well as inside static members

3. The static members from another class should to be accessed by giving class name references.

4. Static members can also be accessed by creating the object to the class. But it is not recommended.

(c) static block: It is used to assign the values to static variables, to call the static methods etc.
